home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / misc / xes120.lha / XES / REXX / FileOp.xdme < prev    next >
Encoding:
Text File  |  1994-11-09  |  1.3 KB  |  69 lines

  1. /* FileOp.xdme */
  2.  
  3. if ~show("L","rexxreqtools.library") then
  4.     if ~addlib("rexxreqtools.library", 0, -30) then exit
  5.  
  6. Parse Arg HAIL .
  7.  
  8. tagstr = "rt_reqpos=reqpos_centerscr rtfi_flags=freqf_patgad"
  9. select
  10.     when HAIL = "Saveas" then do
  11.         oktext = "_Save"
  12.         hailstr = "Save File As ..."
  13.         tagstr = tagstr || "|freqf_save"
  14.     end
  15.     when HAIL = "Replace" then do
  16.         oktext = "_Load"
  17.         hailstr = "Replace File With ..."
  18.     end
  19.     when HAIL = "Decrypt" then do
  20.         oktext = "_Load"
  21.         hailstr = "Select File to Decrypt ..."
  22.     end
  23.     otherwise exit
  24. end
  25.  
  26. options results
  27. address 'XDME.1'
  28. 'rxresult $path'
  29. P = result
  30. 'rxresult $fname'
  31. N = result
  32. 'rxresult $filename'
  33. OF = result
  34.  
  35. F = rtfilerequest(P,N,hailstr,oktext,tagstr)
  36. if rtresult = 0 then exit
  37.  
  38. F0 = '(' || F || ')'
  39. F1 = '"' || F || '"'
  40.  
  41. if HAIL = "Decrypt" then do
  42.     xcom = "execute (copy" F1 "t:temp)"
  43.     xcom
  44.     password = rtgetstring(,,"Please Enter Password")
  45.     xcom = 'execute (xpack t:temp password "' || password || '")'
  46.     xcom
  47.     if OF ~= F then do
  48.         newwindow
  49.     end
  50.     newfile 't:temp'
  51.     chfilename F0
  52.     xcom = 'settvar password' password
  53.     xcom
  54.     call Mode(F)
  55. end
  56. else do
  57.     "mw-"
  58.  
  59.     if HAIL = "Replace" then do
  60.         newfile F0
  61.     end
  62.     else do /* HAIL = "Saveas" */
  63.         chfilename F0
  64.         call Save()
  65.     end
  66. end
  67.  
  68. "mw+"
  69.